package com.adams.custom.page.core.service.impl;

import java.util.List;
import java.util.Map;

import org.apache.log4j.Logger;

import com.adams.core.exception.BusinessException;
import com.adams.custom.page.core.BusinessDealFlowAction;
import com.adams.custom.page.core.BusinessDealFlowContext;
import com.adams.custom.page.core.service.DicTableService;

/**
 * 
 * File Name : DefaultDeleteBusinessDeal.java
 * 
 * @Description : 默认删除数据业务处理
 * @author 904370 张汉辉
 */
public class DefaultDeleteBusinessDeal implements BusinessDealFlowAction
{
	Logger logger = Logger.getLogger(DefaultDeleteBusinessDeal.class.getName());
	/**
	 * Description : 表定义服务类 Author : 904370
	 */
	private DicTableService dicTableService;

	public void setDicTableService(DicTableService dicTableService)
	{
		this.dicTableService = dicTableService;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.adams.custom.page.core.BusinessDealFlowAction#invoke(com.adams.custom.page.core.BusinessDealFlowContext, java.lang.Object)
	 */
	@SuppressWarnings("unchecked")
	@Override
	public Object invoke(BusinessDealFlowContext businessContext,
			Object resultObject) throws BusinessException
	{
		logger.info("DefaultDeleteBusinessDeal invoke method run begin.");
		// TODO Auto-generated method stub
		String tablecode = businessContext.getTablecode();
		List<Map> inputMaps = businessContext.getInputMaps();
		dicTableService.deleteData(tablecode, inputMaps);
		logger.info("DefaultDeleteBusinessDeal invoke method run end.");
		return null;
	}

}
